package com.NeuglsWorkStudio.UI.FormElement.Component
{
	import com.NeuglsWorkStudio.UI.Buttons.TCheckButton;
	import com.NeuglsWorkStudio.UI.FormElement.Config.TCheckBoxConfig;
	import com.NeuglsWorkStudio.UI.FormElement.Config.TConfig;
	
	public class TCheckBox extends TComponent
	{
		private var _FCheckButton:TCheckButton
		public function TCheckBox(AConfig:TConfig)
		{
			super(AConfig);
		}
		
		private function CheckBoxConfig():TCheckBoxConfig{
			return _FConfig as TCheckBoxConfig;
		}
		
		override protected function Init():void{
			super.Init();
			_FCheckButton=new TCheckButton(CheckBoxConfig().Caption);
			_FCheckButton.Checked=CheckBoxConfig().Checked;
			_FCheckButton.OnClick=CheckBoxConfig().OnClick;
			
			this.addChild(_FCheckButton);
		}
	}
}